package models

import "gorm.io/gorm"

type Goods struct {
	gorm.Model
	UserId     int64
	GoodsName  string
	GoodsPrice float64
	Stock      int64
}

func (g *Goods) GetGoodsById() error {
	return DB.Where("id=?", g.ID).Limit(1).Find(g).Error
}

func (g *Goods) CreateGoods() error {
	return DB.Create(&g).Error
}
